#include <stdio.h>
#include <stdlib.h>
#include <streams/streams.h>
#include <appkit/NXBitmapImageRep.h>
#import "kludge.h"
#import "gifread.h"

void main(int argc, char *argv[])
{
	NXStream	*myStream;
	FILE		*myFile;
	id			image;
	
	myFile = fopen(argv[1], "r");
	myStream = NXOpenFile(fileno(myFile), NX_READONLY);
	
	image = ReadGIF(myStream, 1);
	
	NXClose(myStream);
	fclose(myFile);

	myStream = NXOpenFile(fileno(stdout), NX_WRITEONLY);
	[image writeTIFF: myStream];
	[image free];
	NXClose(myStream);
}